package com.yuda.afterexamscore.service.impl;

import com.yuda.afterexamscore.domain.TsinghuaFormalAnswer;
import com.yuda.afterexamscore.mapper.TsinghuaFormalAnswerMapper;
import com.yuda.afterexamscore.service.ITsinghuaFormalAnswerService;
import com.yuda.afterexamscore.vo.TsinghuaFormalAnswerVo;
import com.yuda.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 清华管理机学生答案Service业务层处理
 *
 * @author wyn
 * @date 2021-05-12
 */
@Service
public class TsinghuaFormalAnswerServiceImpl implements ITsinghuaFormalAnswerService
{
    @Autowired
    private TsinghuaFormalAnswerMapper tsinghuaFormalAnswerMapper;

    /**
     * 查询清华管理机学生答案
     *
     * @param id 清华管理机学生答案ID
     * @return 清华管理机学生答案
     */
    @Override
    public TsinghuaFormalAnswer selectTsinghuaFormalAnswerById(Integer id)
    {
        return tsinghuaFormalAnswerMapper.selectTsinghuaFormalAnswerById(id);
    }

    /**
     * 查询清华管理机学生答案列表
     *
     * @param tsinghuaFormalAnswer 清华管理机学生答案
     * @return 清华管理机学生答案
     */
    @Override
    public List<TsinghuaFormalAnswer> selectTsinghuaFormalAnswerList(TsinghuaFormalAnswer tsinghuaFormalAnswer)
    {
        return tsinghuaFormalAnswerMapper.selectTsinghuaFormalAnswerList(tsinghuaFormalAnswer);
    }

    /**
     * 新增清华管理机学生答案
     *
     * @param tsinghuaFormalAnswer 清华管理机学生答案
     * @return 结果
     */
    @Override
    public int insertTsinghuaFormalAnswer(TsinghuaFormalAnswer tsinghuaFormalAnswer)
    {
        tsinghuaFormalAnswer.setCreateTime(DateUtils.getNowDate());
        return tsinghuaFormalAnswerMapper.insertTsinghuaFormalAnswer(tsinghuaFormalAnswer);
    }

    /**
     * 修改清华管理机学生答案
     *
     * @param tsinghuaFormalAnswer 清华管理机学生答案
     * @return 结果
     */
    @Override
    public int updateTsinghuaFormalAnswer(TsinghuaFormalAnswer tsinghuaFormalAnswer)
    {
        tsinghuaFormalAnswer.setUpdateTime(DateUtils.getNowDate());
        return tsinghuaFormalAnswerMapper.updateTsinghuaFormalAnswer(tsinghuaFormalAnswer);
    }

    /**
     * 批量删除清华管理机学生答案
     *
     * @param ids 需要删除的清华管理机学生答案ID
     * @return 结果
     */
    @Override
    public int deleteTsinghuaFormalAnswerByIds(Integer[] ids)
    {
        return tsinghuaFormalAnswerMapper.deleteTsinghuaFormalAnswerByIds(ids);
    }

    /**
     * 删除清华管理机学生答案信息
     *
     * @param id 清华管理机学生答案ID
     * @return 结果
     */
    @Override
    public int deleteTsinghuaFormalAnswerById(Integer id)
    {
        return tsinghuaFormalAnswerMapper.deleteTsinghuaFormalAnswerById(id);
    }

    /**
     * 查询所有填空题答案
     *
     */
    @Override
    public List<TsinghuaFormalAnswerVo> queryAllCompletionAnswers(String subjectId) {
        return tsinghuaFormalAnswerMapper.queryAllCompletionAnswers(subjectId);
    }

    @Override
    public String findExamUuid() {
        return tsinghuaFormalAnswerMapper.findExamUuid();
    }
}
